package com.corona.game;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.corona.Game;
import com.corona.game.util.SmolSprite;
import com.corona.game.util.SpriteProxy;
import com.corona.game.util.TextureCache;
import com.corona.game.util.audio.AudioLoader;
import com.sun.jna.platform.win32.WinError;
import java.util.Iterator;
import java.util.Random;
import org.lwjgl.glfw.GLFW;

/* compiled from: PkmnMap.java */
/* loaded from: pokewilds.jar:com/pkmngen/game/RegigigasIntroAnim.class */
class RegigigasIntroAnim extends Action {
    Tile regiTile;
    Tile pedistalTile;
    Music soundEffect;
    Music soundEffect2;
    String dirFacing;
    String regiName;
    int timer = 0;
    int phase = 0;
    int regionNum = 0;
    Sprite lightningSprite = new Sprite(TextureCache.get(Gdx.files.internal("lightning1.png")), 0, 0, 160, 144);

    public RegigigasIntroAnim(String regiName, String dirFacing, Action nextAction) {
        super(new Object[0]);
        this.dirFacing = "left";
        this.regiName = regiName;
        this.dirFacing = dirFacing;
        this.nextAction = nextAction;
    }

    @Override // com.corona.game.Action
    public void firstStep(Game game) {
        Iterator<Tile> it = game.map.tiles.values().iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            Tile tile = it.next();
            if (tile.name.equals("cave1_regi1")) {
                this.regiTile = tile;
                break;
            }
        }
        Iterator<Tile> it2 = game.map.tiles.values().iterator();
        while (true) {
            if (!it2.hasNext()) {
                break;
            }
            Tile tile2 = it2.next();
            if (tile2.name.contains("cave1_regipedistal1")) {
                this.pedistalTile = tile2;
                break;
            }
        }
        this.soundEffect2 = AudioLoader.loadMusic("sounds/splash1.ogg");
        this.soundEffect2.setLooping(false);
        this.soundEffect2.setVolume(0.3f);
        this.soundEffect = AudioLoader.loadMusic("sounds/stomp1.ogg");
        this.soundEffect.setLooping(true);
        this.soundEffect.setVolume(0.7f);
    }

    @Override // com.corona.game.Action
    public void step(Game game) {
        if (this.phase == 0) {
            if (this.timer == 0) {
                this.soundEffect.play();
            }
            if (this.timer < 60 * 8) {
                if (this.timer % 4 == 0) {
                    game.cam.translate(0.0f, 2.0f);
                    game.player.position.add(0.0f, 2.0f);
                    this.regiTile.sprite.translateY(2.0f);
                } else if (this.timer % 4 == 2) {
                    game.cam.translate(0.0f, -2.0f);
                    game.player.position.add(0.0f, -2.0f);
                    this.regiTile.sprite.translateY(-2.0f);
                }
            }
            if (this.timer == 60 * 2) {
                this.regiTile.sprite.setRegionX(32);
                this.regiTile.sprite.setRegionWidth(32);
                this.soundEffect2.play();
            } else if (this.timer == 60 * 4) {
                this.regiTile.sprite.setRegionX(64);
                this.regiTile.sprite.setRegionWidth(32);
                this.soundEffect2.play();
            } else if (this.timer == 60 * 6) {
                this.regiTile.sprite.setRegionX(96);
                this.regiTile.sprite.setRegionWidth(32);
                this.soundEffect2.play();
            } else if (this.timer == 60 * 8) {
                this.regiTile.sprite.setRegionX(128);
                this.regiTile.sprite.setRegionWidth(32);
                this.soundEffect.stop();
            } else if (this.timer == 60 * 10) {
                this.phase = 1;
                this.timer = 0;
            }
        } else if (this.phase == 1) {
            if (this.timer == 1) {
                this.soundEffect.stop();
                this.soundEffect.dispose();
                this.soundEffect = AudioLoader.loadMusic("sounds/gigas_noises14.ogg");
                this.soundEffect.setVolume(1.0f);
                this.soundEffect.play();
            }
            if (this.timer < 36) {
                if (this.timer < 18) {
                    if (this.timer % 4 == 0) {
                        this.regiTile.sprite.setRegion(192, 0, 32, 32);
                    } else if (this.timer % 4 == 2) {
                        this.regiTile.sprite.setRegion(128, 0, 32, 32);
                    }
                } else if (this.timer < 36) {
                    if (this.timer % 6 == 0) {
                        this.regiTile.sprite.setRegion(192, 0, 32, 32);
                    } else if (this.timer % 6 == 3) {
                        this.regiTile.sprite.setRegion(128, 0, 32, 32);
                    }
                }
            } else if (this.timer >= 70) {
                if (this.timer < 106) {
                    if (this.timer == 70) {
                        this.soundEffect.stop();
                        this.soundEffect.play();
                    }
                    if (this.timer < 88) {
                        if (this.timer % 4 == 0) {
                            this.regiTile.sprite.setRegion(224, 0, 32, 32);
                        } else if (this.timer % 4 == 2) {
                            this.regiTile.sprite.setRegion(128, 0, 32, 32);
                        }
                    } else if (this.timer < 106) {
                        if (this.timer % 6 == 0) {
                            this.regiTile.sprite.setRegion(224, 0, 32, 32);
                        } else if (this.timer % 6 == 3) {
                            this.regiTile.sprite.setRegion(128, 0, 32, 32);
                        }
                    }
                } else if (this.timer >= 110) {
                    if (this.timer < 146) {
                        if (this.timer == 110) {
                            this.soundEffect.stop();
                            this.soundEffect.play();
                        }
                        if (this.timer < 128) {
                            if (this.timer % 4 == 0) {
                                this.regiTile.sprite.setRegion(288, 0, 32, 32);
                            } else if (this.timer % 4 == 2) {
                                this.regiTile.sprite.setRegion(128, 0, 32, 32);
                            }
                        } else if (this.timer < 146) {
                            if (this.timer % 6 == 0) {
                                this.regiTile.sprite.setRegion(288, 0, 32, 32);
                            } else if (this.timer % 6 == 3) {
                                this.regiTile.sprite.setRegion(128, 0, 32, 32);
                            }
                        }
                    } else if (this.timer >= 150) {
                        if (this.timer < 186) {
                            if (this.timer == 150) {
                                this.soundEffect.stop();
                                this.soundEffect.play();
                            }
                            if (this.timer < 168) {
                                if (this.timer % 4 == 0) {
                                    this.regiTile.sprite.setRegion(256, 0, 32, 32);
                                } else if (this.timer % 4 == 2) {
                                    this.regiTile.sprite.setRegion(128, 0, 32, 32);
                                }
                            } else if (this.timer < 186) {
                                if (this.timer % 6 == 0) {
                                    this.regiTile.sprite.setRegion(256, 0, 32, 32);
                                } else if (this.timer % 6 == 3) {
                                    this.regiTile.sprite.setRegion(128, 0, 32, 32);
                                }
                            }
                        } else if (this.timer >= 220) {
                            this.phase = 4;
                            this.timer = 0;
                        }
                    }
                }
            }
        } else if (this.phase == 1) {
            if (this.timer == 20) {
                this.soundEffect.stop();
                this.soundEffect.dispose();
                this.soundEffect = AudioLoader.loadMusic("sounds/gigas_noises2.ogg");
                this.soundEffect.setVolume(1.0f);
                this.soundEffect.play();
                this.soundEffect.pause();
                this.soundEffect.setPosition(5.0f);
            }
            if (this.timer >= 120) {
                if (this.timer < 180) {
                    if (this.timer == 120) {
                        this.soundEffect.play();
                    }
                    if (this.timer % 6 == 0) {
                        this.regiTile.sprite.setRegionX(160);
                        this.regiTile.sprite.setRegionWidth(32);
                    } else if (this.timer % 6 == 3) {
                        this.regiTile.sprite.setRegionX(128);
                        this.regiTile.sprite.setRegionWidth(32);
                    }
                } else if (this.timer >= 240) {
                    this.soundEffect.stop();
                    this.phase++;
                    this.timer = 0;
                }
            }
        } else if (this.phase == 1) {
            if (this.timer == 2) {
                this.soundEffect.stop();
                this.soundEffect.dispose();
            }
            if (this.timer == 20) {
                this.soundEffect = AudioLoader.loadMusic("sounds/gigas_noises7.ogg");
                this.soundEffect.setVolume(1.0f);
            }
            if (this.timer >= 80) {
                if (this.timer < 140) {
                    if (this.timer % 4 == 0) {
                        this.regiTile.sprite.setRegionX(128);
                        this.regiTile.sprite.setRegionWidth(32);
                        this.soundEffect.stop();
                        this.soundEffect.play();
                    } else if (this.timer % 4 == 3) {
                        this.regiTile.sprite.setRegionX(160);
                        this.regiTile.sprite.setRegionWidth(32);
                    }
                } else if (this.timer >= 200) {
                    this.phase++;
                    this.timer = 0;
                }
            }
        } else if (this.phase == 2 || this.phase == 3) {
            if (this.timer == 2) {
                this.soundEffect.stop();
                this.soundEffect.dispose();
            }
            if (this.timer == 20) {
                this.soundEffect = AudioLoader.loadMusic("sounds/gigas_noises9.ogg");
                this.soundEffect.setVolume(1.0f);
                this.soundEffect.play();
                this.regiTile.sprite.setRegion(192, 0, 32, 32);
            } else if (this.timer == 24) {
                this.regiTile.sprite.setRegion(224, 0, 32, 32);
            } else if (this.timer == 28) {
                this.regiTile.sprite.setRegion(256, 0, 32, 32);
            } else if (this.timer == 32) {
                this.regiTile.sprite.setRegion(288, 0, 32, 32);
            } else if (this.timer == 36) {
                this.regiTile.sprite.setRegion(128, 0, 32, 32);
            } else if (this.timer == 100) {
                this.phase++;
                this.timer = 0;
            }
        } else if (this.phase == 4) {
            if (this.timer >= 30) {
                if (this.timer < 60) {
                    if (this.timer % 6 == 0) {
                        this.regiTile.sprite.setRegion(128, 0, 32, 32);
                    } else if (this.timer % 6 == 3) {
                        this.regiTile.sprite.setRegion(160, 0, 32, 32);
                    }
                } else if (this.timer >= 80) {
                    if (this.timer < 160) {
                        if (this.timer % 4 == 0) {
                            game.cam.translate(0.0f, 2.0f);
                            game.player.position.add(0.0f, 2.0f);
                            this.regiTile.sprite.translateY(2.0f);
                        } else if (this.timer % 4 == 2) {
                            game.cam.translate(0.0f, -2.0f);
                            game.player.position.add(0.0f, -2.0f);
                            this.regiTile.sprite.translateY(-2.0f);
                        }
                    } else if (this.timer < 220) {
                        if (this.timer % 6 == 0) {
                            this.pedistalTile.overSprite.setRegion(0, 0, 16, 16);
                        } else if (this.timer % 6 == 3) {
                            this.pedistalTile.overSprite.setRegion(this.regionNum, 0, 16, 16);
                        }
                    }
                }
            }
            if (this.timer == 1) {
                this.lightningSprite.setRegion(WinError.ERROR_MULTIPLE_FAULT_VIOLATION, 0, 160, 144);
                this.soundEffect.stop();
                this.soundEffect.dispose();
                this.soundEffect2.stop();
                this.soundEffect2.dispose();
                if (this.regiName.equals("REGIDRAGO")) {
                    this.regionNum = 16;
                } else if (this.regiName.equals("REGIELEKI")) {
                    this.regionNum = 32;
                } else if (this.regiName.equals("REGICE")) {
                    this.regionNum = 48;
                } else if (this.regiName.equals("REGIROCK")) {
                    this.regionNum = 64;
                } else if (this.regiName.equals("REGISTEEL")) {
                    this.regionNum = 80;
                }
            } else if (this.timer == 60) {
                this.soundEffect = AudioLoader.loadMusic("attacks/thunderpunch_player_gsc/sound.ogg");
                this.soundEffect.setVolume(1.0f);
                this.soundEffect.play();
                SpriteProxy.inverseColors = true;
                this.lightningSprite.setRegion(0, 0, 160, 144);
                game.insertAction(new LightningFlash(null));
            } else if (this.timer == 62) {
                SpriteProxy.inverseColors = false;
                this.lightningSprite.setRegion(160, 0, 160, 144);
            } else if (this.timer == 64) {
                SpriteProxy.inverseColors = true;
                this.lightningSprite.setRegion(GLFW.GLFW_KEY_KP_0, 0, 160, 144);
            } else if (this.timer == 68) {
                SpriteProxy.inverseColors = false;
                this.lightningSprite.setRegion(480, 0, 160, 144);
            } else if (this.timer == 80) {
                this.lightningSprite.setRegion(WinError.ERROR_MULTIPLE_FAULT_VIOLATION, 0, 160, 144);
            } else if (this.timer == 160) {
                this.regiTile.sprite.setRegion(128, 0, 32, 32);
                this.soundEffect2 = AudioLoader.loadMusic("sounds/hit.ogg");
                this.soundEffect2.setVolume(1.0f);
                this.soundEffect2.play();
                String knockBackDir = "left";
                if (this.dirFacing.equals("right")) {
                    knockBackDir = "left";
                } else if (this.dirFacing.equals("up")) {
                    knockBackDir = "down";
                }
                game.player.dirFacing = this.dirFacing;
                game.player.currSprite = game.player.standingSprites.get(game.player.dirFacing);
                game.insertAction(new PlayerKnockedBack(game, game.player, knockBackDir));
                this.regiTile.name = "cave1_regi2";
                this.pedistalTile.nameUpper = this.regiName;
                this.pedistalTile.overSprite = new SmolSprite(TextureCache.get(Gdx.files.internal("tiles/cave1/overworld2.png")), this.regionNum, 0, 16, 16);
                this.pedistalTile.overSprite.setPosition(this.pedistalTile.position.x, this.pedistalTile.position.y);
            } else if (this.timer == 190) {
                game.playerCanMove = true;
            } else if (this.timer == 230) {
                this.soundEffect.stop();
                this.soundEffect.dispose();
                this.soundEffect2.stop();
                this.soundEffect2.dispose();
                game.actionStack.remove(this);
            }
            game.mapBatch.draw(this.lightningSprite, this.regiTile.position.x - 110.0f, this.regiTile.position.y - 94.0f);
        }
        this.timer++;
    }

    /* compiled from: PkmnMap.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/RegigigasIntroAnim$RocksEffect1.class */
    static class RocksEffect1 extends Action {
        public static float velocityX = 2.0f;
        public static boolean shouldMoveX = true;
        public static boolean shouldMoveY = true;
        public Action.Layer layer = Action.Layer.gui_111;
        Sprite[] sprites = new Sprite[20];
        int[] velocities = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
        int[] velocities2 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
        int velocity = 1;
        int whichVelocity = 0;
        Random rand = new Random();
        boolean firstStep = true;
        Sprite textboxSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/battle_bg4.png")), 0, 0, 176, 160);

        public RocksEffect1() {
            super(new Object[0]);
            this.textboxSprite.setPosition(-8.0f, -8.0f);
            Texture text = TextureCache.get(Gdx.files.internal("battle/rock2.png"));
            this.sprites[0] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[0].setColor(1.0f, 1.0f, 1.0f, 1.0f);
            this.sprites[1] = new Sprite(text, 32, 0, 32, 32);
            this.sprites[2] = new Sprite(text, 64, 0, 32, 32);
            this.sprites[3] = new Sprite(text, 160, 0, 32, 32);
            this.sprites[4] = new Sprite(text, 192, 0, 32, 32);
            this.sprites[5] = new Sprite(text, 32, 0, 32, 32);
            this.sprites[6] = new Sprite(text, 64, 0, 32, 32);
            this.sprites[7] = new Sprite(text, 160, 0, 32, 32);
            this.sprites[8] = new Sprite(text, 192, 0, 32, 32);
            this.sprites[9] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[10] = new Sprite(text, 32, 0, 32, 32);
            this.sprites[11] = new Sprite(text, 64, 0, 32, 32);
            this.sprites[12] = new Sprite(text, 160, 0, 32, 32);
            this.sprites[13] = new Sprite(text, 192, 0, 32, 32);
            this.sprites[14] = new Sprite(text, 32, 0, 32, 32);
            this.sprites[15] = new Sprite(text, 64, 0, 32, 32);
            this.sprites[16] = new Sprite(text, 160, 0, 32, 32);
            this.sprites[17] = new Sprite(text, 192, 0, 32, 32);
            this.sprites[18] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[19] = new Sprite(text, 0, 0, 32, 32);
            for (int i = 0; i < 20; i++) {
                this.sprites[i].setPosition((float) (this.rand.nextInt(192) - 32), (float) (this.rand.nextInt(144) - 144));
                this.sprites[i].setRotation((float) (this.rand.nextInt(4) * 90));
                this.velocities[i] = 2;
                this.velocities2[i] = this.velocities[i] - 1;
            }
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (this.firstStep) {
                RocksEffect2.drawRocks = true;
                this.firstStep = false;
            }
            for (int i = 0; i < 20; i++) {
                if (this.whichVelocity == 0) {
                    this.velocity = this.velocities[i];
                } else {
                    this.velocity = this.velocities2[i];
                }
                if (!shouldMoveY) {
                    this.velocity = 0;
                }
                velocityX = 0.0f;
                this.sprites[i].setPosition(this.sprites[i].getX() + velocityX, this.sprites[i].getY() + ((float) this.velocity));
                if (this.sprites[i].getY() > 144.0f) {
                    this.sprites[i].setPosition((float) (this.rand.nextInt(192) - 32), (float) (this.rand.nextInt(144) - 144));
                }
                if (this.sprites[i].getX() > 160.0f) {
                    this.sprites[i].setPosition(-32.0f, this.sprites[i].getY());
                }
                this.sprites[i].draw(game.uiBatch);
            }
            this.whichVelocity = (this.whichVelocity + 1) % 2;
            this.textboxSprite.draw(game.uiBatch);
            if (game.battle.drawAction == null) {
                game.actionStack.remove(this);
            }
        }
    }

    /* compiled from: PkmnMap.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/RegigigasIntroAnim$RocksEffect2.class */
    static class RocksEffect2 extends Action {
        public static int velocityX = 0;
        public static boolean shouldMoveX = false;
        public static boolean shouldMoveY = true;
        static boolean drawRocks = false;
        public Action.Layer layer = Action.Layer.gui_131;
        Sprite[] sprites = new Sprite[10];
        int[] velocities = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
        int[] velocities2 = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
        int velocity = 1;
        int whichVelocity = 0;
        Random rand = new Random();
        float[] bg_values = {0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 8.0f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 8.0f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.8f, 0.9f, 0.9f, 0.9f, 0.9f, 0.9f, 0.9f, 0.95f, 0.95f, 0.95f, 0.95f, 0.95f, 0.95f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 1.0f, 0.95f, 0.95f, 0.95f, 0.95f, 0.95f, 0.95f, 0.9f, 0.9f, 0.9f, 0.9f, 0.9f, 0.9f};
        int bg_values_idx = 0;
        float curr_value = 0.0f;
        Sprite bgSprite = new Sprite(TextureCache.get(Gdx.files.internal("battle/battle_bg3.png")), 0, 0, 176, 160);
        Sprite bgSprite2 = new Sprite(TextureCache.get(Gdx.files.internal("battle/battle_bg5.png")), 0, 0, 176, 160);

        public RocksEffect2() {
            super(new Object[0]);
            this.bgSprite.setPosition(-8.0f, -8.0f);
            this.bgSprite2.setPosition(-8.0f, -8.0f);
            Texture text = TextureCache.get(Gdx.files.internal("battle/rock1.png"));
            this.sprites[0] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[0].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[1] = new Sprite(text, 32, 0, 32, 32);
            this.sprites[1].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[2] = new Sprite(text, 64, 0, 32, 32);
            this.sprites[2].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[3] = new Sprite(text, 160, 0, 32, 32);
            this.sprites[3].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[4] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[4].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[5] = new Sprite(text, 32, 0, 32, 32);
            this.sprites[5].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[6] = new Sprite(text, 64, 0, 32, 32);
            this.sprites[6].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[7] = new Sprite(text, 160, 0, 32, 32);
            this.sprites[7].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[8] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[8].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            this.sprites[9] = new Sprite(text, 0, 0, 32, 32);
            this.sprites[9].setColor(0.0f, 0.0f, 0.0f, 1.0f);
            for (int i = 0; i < 10; i++) {
                this.sprites[i].setPosition((float) this.rand.nextInt(128), (float) (this.rand.nextInt(46) + 20));
                this.velocities[i] = this.rand.nextInt(5) + 4;
                this.velocities2[i] = this.velocities[i];
                this.sprites[i].setRotation((float) (this.rand.nextInt(4) * 90));
            }
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return this.layer;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            this.bgSprite.draw(game.uiBatch);
            if (drawRocks) {
                for (int i = 0; i < 10; i++) {
                    if (this.velocities2[i] <= 0) {
                        this.velocity = 1;
                        this.velocities2[i] = this.velocities[i];
                    } else {
                        this.velocity = 0;
                    }
                    int[] iArr = this.velocities2;
                    iArr[i] = iArr[i] - 1;
                    if (!shouldMoveY) {
                        this.velocity = 0;
                    }
                    this.sprites[i].setPosition(this.sprites[i].getX() + ((float) velocityX), this.sprites[i].getY() + ((float) this.velocity));
                    if (this.sprites[i].getY() > 144.0f) {
                        this.sprites[i].setPosition((float) this.rand.nextInt(128), (float) (this.rand.nextInt(46) + 20));
                        this.sprites[i].setRotation((float) (this.rand.nextInt(4) * 90));
                        this.velocities[i] = this.rand.nextInt(5) + 4;
                        this.velocities2[i] = this.velocities[i];
                    }
                    if (this.sprites[i].getX() < 0.0f) {
                        this.sprites[i].setPosition(160.0f, (float) this.rand.nextInt(112));
                        this.sprites[i].setRotation((float) (this.rand.nextInt(4) * 90));
                    }
                    this.sprites[i].draw(game.uiBatch);
                }
                this.whichVelocity = (this.whichVelocity + 1) % 2;
                this.bgSprite2.draw(game.uiBatch);
            }
            if (game.battle.drawAction == null) {
                game.actionStack.remove(this);
            }
        }
    }

    /* compiled from: PkmnMap.java */
    /* loaded from: pokewilds.jar:com/pkmngen/game/RegigigasIntroAnim$BattleIntro.class */
    public static class BattleIntro extends Action {
        public int timer = 0;
        public Sprite sprite = new Sprite(TextureCache.get(Gdx.files.internal("tiles/cave1/regi_eye1.png")), 0, 0, 16, 16);

        public BattleIntro(Action nextAction) {
            super(new Object[0]);
            this.nextAction = nextAction;
        }

        @Override // com.corona.game.Action
        public void firstStep(Game game) {
        }

        @Override // com.corona.game.Action
        public String getCamera() {
            return "gui";
        }

        @Override // com.corona.game.Action
        public Action.Layer getLayer() {
            return Action.Layer.gui_140;
        }

        @Override // com.corona.game.Action
        public void step(Game game) {
            if (this.timer > 0) {
                float alpha = 1.0f;
                if (this.timer < 2) {
                    alpha = 0.3f;
                } else if (this.timer < 4) {
                    alpha = 0.6f;
                }
                this.sprite.setAlpha(alpha);
                this.sprite.setPosition(48.0f, 8.0f);
                this.sprite.draw(game.uiBatch);
            }
            if (this.timer > 70) {
                float alpha2 = 1.0f;
                if (this.timer < 72) {
                    alpha2 = 0.3f;
                } else if (this.timer < 74) {
                    alpha2 = 0.6f;
                }
                this.sprite.setAlpha(alpha2);
                this.sprite.setPosition(16.0f, 56.0f);
                this.sprite.draw(game.uiBatch);
            }
            if (this.timer > 140) {
                float alpha3 = 1.0f;
                if (this.timer < 142) {
                    alpha3 = 0.3f;
                } else if (this.timer < 144) {
                    alpha3 = 0.6f;
                }
                this.sprite.setAlpha(alpha3);
                this.sprite.setPosition(48.0f, 104.0f);
                this.sprite.draw(game.uiBatch);
            }
            if (this.timer > 184) {
                float alpha4 = 1.0f;
                if (this.timer < 186) {
                    alpha4 = 0.3f;
                } else if (this.timer < 188) {
                    alpha4 = 0.6f;
                }
                this.sprite.setAlpha(alpha4);
                game.uiBatch.draw(this.sprite, 96.0f, 104.0f);
            }
            if (this.timer > 218) {
                float alpha5 = 1.0f;
                if (this.timer < 220) {
                    alpha5 = 0.3f;
                } else if (this.timer < 222) {
                    alpha5 = 0.6f;
                }
                this.sprite.setAlpha(alpha5);
                this.sprite.setPosition(128.0f, 56.0f);
                this.sprite.draw(game.uiBatch);
            }
            if (this.timer > 244) {
                float alpha6 = 1.0f;
                if (this.timer < 246) {
                    alpha6 = 0.3f;
                } else if (this.timer < 248) {
                    alpha6 = 0.6f;
                }
                this.sprite.setAlpha(alpha6);
                this.sprite.setPosition(96.0f, 8.0f);
                this.sprite.draw(game.uiBatch);
            }
            if (this.timer >= 370) {
                game.actionStack.remove(this);
                game.insertAction(this.nextAction);
            }
            this.timer++;
        }
    }
}
